class UsersController < ApplicationController
  skip_before_filter :require_login,only: [:new,:create]
  def new
    @user = User.new
    @signup = true
    render layout: 'user_form'
  end
  def create
    @user = User.new(user_params)
    if @user.save
      flash[:success] = "successfull"
        respond_to do |format|
          format.html { redirect_to root_path }
          format.js
        end
    end
  end
  private
  def user_params
    params.require(:user).permit(:name, :email, :password, :password_confirmation)
  end

end
